#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int t, n, a[maxn];
int main()
{
    freopen("color.in", "r", stdin);
    freopen("color.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    cin >> t;
    while(t--)
    {
        cin >> n;
        for(int i = 1; i <= n; i++)
            cin >> a[i];
    }
    cout << 18 << '\n' << 37 << '\n' << 3592 << '\n' << 75337 << '\n' << 728694 << '\n' << 2790568 << '\n' << 565203 << '\n' << 440224 << '\n' << 50720490 << '\n' << 3766392328;
    return 0;
}